home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / dev / misc / libx11inc.lha / X11 / Xm / GadgetP.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-13  |  4.3 KB  |  180 lines

  1. /* 
  2.  * (c) Copyright 1989, 1990, 1991, 1992 OPEN SOFTWARE FOUNDATION, INC.
  3.  * ALL RIGHTS RESERVED
  4. */ 
  5. /*   $RCSfile: GadgetP.h,v $ $Revision: 1.10 $ $Date: 92/05/14 12:52:15 $ */
  6. /*
  7. *  (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 HEWLETT-PACKARD COMPANY */
  8. /*
  9. *  (c) Copyright 1989, 1990 DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
  10. /*
  11. *  (c) Copyright 1988 MASSACHUSETTS INSTITUTE OF TECHNOLOGY  */
  12. #ifndef _XmGadgetP_h
  13. #define _XmGadgetP_h
  14.  
  15. #ifndef _XmNO_BC_INCL
  16. #define _XmNO_BC_INCL
  17. #endif
  18.  
  19. #include <Xm/XmP.h>
  20.  
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24.  
  25.  
  26. /*  Masks to define input the gadget is interested in  */
  27.  
  28. #define XmNO_EVENT              0x000
  29. #define XmENTER_EVENT           0x001
  30. #define XmLEAVE_EVENT           0x002
  31. #define XmFOCUS_IN_EVENT        0x004
  32. #define XmFOCUS_OUT_EVENT       0x008
  33. #define XmMOTION_EVENT          0x010
  34. #define XmARM_EVENT             0x020
  35. #define XmACTIVATE_EVENT        0x040
  36. #define XmHELP_EVENT            0x080
  37. #define XmKEY_EVENT             0x100
  38. #define XmMULTI_ARM_EVENT       0x200
  39. #define XmMULTI_ACTIVATE_EVENT  0x400
  40. #define XmBDRAG_EVENT        0x800
  41. #define XmALL_EVENT             0xFFF
  42.  
  43.  
  44. /* Gadget access Macros */
  45. #define G_ShadowThickness(g) \
  46.     (((XmGadget)(g))->gadget.shadow_thickness)
  47. #define G_HighlightThickness(g) \
  48.     (((XmGadget)(g))->gadget.highlight_thickness)
  49.  
  50. #define GCEPTR(wc)  ((XmGadgetClassExt *)(&(((XmGadgetClass)(wc))->gadget_class.extension)))
  51. #define _XmGetGadgetClassExtPtr(wc, owner) \
  52.   ((*GCEPTR(wc) && (((*GCEPTR(wc))->record_type) == owner))\
  53.    ? GCEPTR(wc) \
  54.    :((XmGadgetClassExt *) _XmGetClassExtensionPtr(((XmGenericClassExt *)GCEPTR(wc)), owner)))
  55.  
  56. #define XmGadgetClassExtVersion 1L
  57.  
  58.  
  59. /* Gadget cache header for each gadget's Cache Part */
  60.  
  61. typedef struct _XmGadgetCache
  62. {
  63.    struct _XmGadgetCache    *next;
  64.    struct _XmGadgetCache    *prev;
  65.    int                ref_count;
  66. } XmGadgetCache, *XmGadgetCachePtr;
  67.  
  68.  
  69. /* A cache entry for each class which desires gadget caching */
  70.  
  71. typedef struct _XmCacheClassPart 
  72. {
  73.    XmGadgetCache    cache_head;
  74.    XmCacheCopyProc    cache_copy;
  75.    XmGadgetCacheProc    cache_delete;
  76.    XmCacheCompareProc   cache_compare;
  77. } XmCacheClassPart, *XmCacheClassPartPtr;
  78.  
  79. typedef struct _XmGadgetCacheRef
  80. {
  81.    struct _XmGadgetCache    *next;
  82.    struct _XmGadgetCache    *prev;
  83.    int                ref_count;
  84.    int                data;
  85. } XmGadgetCacheRef, *XmGadgetCacheRefPtr;
  86.  
  87. /*  Gadget class structure  */
  88.  
  89. typedef struct _XmGadgetClassExtRec{
  90.     XtPointer           next_extension;
  91.     XrmQuark            record_type;
  92.     long                version;
  93.     Cardinal            record_size;
  94.     XmWidgetBaselineProc widget_baseline;
  95.     XmWidgetDisplayRectProc  widget_display_rect;
  96. }XmGadgetClassExtRec, *XmGadgetClassExt;
  97.  
  98. typedef struct _XmGadgetClassPart
  99. {
  100.    XtWidgetProc         border_highlight;
  101.    XtWidgetProc         border_unhighlight;
  102.    XtActionProc         arm_and_activate;
  103.    XmWidgetDispatchProc input_dispatch;
  104.    XmVisualChangeProc   visual_change;
  105.    XmSyntheticResource * syn_resources;   
  106.    int                  num_syn_resources;   
  107.    XmCacheClassPartPtr    cache_part;
  108.    XtPointer        extension;
  109. } XmGadgetClassPart;
  110.  
  111.  
  112. /*  Full class record declaration for Gadget class  */
  113.  
  114. typedef struct _XmGadgetClassRec
  115. {
  116.    RectObjClassPart  rect_class;
  117.    XmGadgetClassPart gadget_class;
  118. } XmGadgetClassRec;
  119.  
  120. #ifndef GADGET
  121. externalref XmGadgetClassRec xmGadgetClassRec;
  122. #endif
  123.  
  124.  
  125. /*  The Gadget instance record  */
  126.  
  127. typedef struct _XmGadgetPart
  128. {
  129.    Dimension shadow_thickness;
  130.    Dimension highlight_thickness;
  131.  
  132.    XtCallbackList help_callback;
  133.    XtPointer      user_data;
  134.  
  135.    Boolean traversal_on;
  136.    Boolean highlight_on_enter;
  137.    Boolean have_traversal;
  138.  
  139.    unsigned char unit_type;
  140.    XmNavigationType navigation_type;
  141.  
  142.    Boolean highlight_drawn;
  143.    Boolean highlighted;
  144.    Boolean visible;
  145.  
  146.    Mask event_mask;
  147. } XmGadgetPart;
  148.  
  149. /*  Full instance record declaration  */
  150.  
  151. typedef struct _XmGadgetRec
  152. {
  153.    ObjectPart   object;
  154.    RectObjPart  rectangle;
  155.    XmGadgetPart gadget;
  156. } XmGadgetRec;
  157.  
  158.  
  159.  
  160. /********    Private Function Declarations    ********/
  161. #ifdef _NO_PROTO
  162.  
  163. extern void _XmBuildGadgetResources() ;
  164.  
  165. #else
  166.  
  167. extern void _XmBuildGadgetResources( 
  168.                         WidgetClass c) ;
  169.  
  170. #endif /* _NO_PROTO */
  171. /********    End Private Function Declarations    ********/
  172.  
  173.  
  174. #ifdef __cplusplus
  175. }  /* Close scope of 'extern "C"' declaration which encloses file. */
  176. #endif
  177.  
  178. #endif /* _XmGadgetP_h */
  179. /* DON'T ADD ANYTHING AFTER THIS #endif */
  180.